import axios from '@/utils/axios'

export const getMenu = (id: string): Promise<ApiResult<BaseMenuPO>> => {
  return axios.get(`base/menu/${id}`)
}

export const getMenuListByAppId = (appId: string): Promise<ApiResult<BaseMenuPO[]>> => {
  return axios.get(`base/menu/list/${appId}`)
}

export const postAndPutMenu = (data: BaseMenuPO): Promise<ApiResult<null>> => {
  return axios.post(`base/menu`, data)
}

export const deleteMenu = (id: string): Promise<ApiResult<null>> => {
  return axios.delete(`base/menu/${id}`)
}
